<%@ page contentType="text/html; charset=utf-8" %>

<html>
<head>
<link rel="stylesheet" href="<%=request.getContextPath()%>/styles/style.css" type="text/css">
<meta http-equiv="Cache-Control" content="no-store"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<title>引擎控制</title>
</head>
<% 
String status = (String)request.getAttribute("status");
 %>
<body>
<table align="center" width="50%">
<tr><td></td></tr>
<tr>
<td>
<input type="button" id="button_start" value="启动引擎" name="start" onclick="startEngine()" class="gradientBtn" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" id="button_stop" value="停止引擎" name="stop" onclick="stopEngine()" class="gradientBtn" ></td>
</tr>
</table>
<form method="post" name="engineForm"></form>
</body>
</html>
<script>
var status = "<%=status%>"

if(status == "run"){
	document.getElementById("button_start").disabled = true;
}else{
	document.getElementById("button_stop").disabled = true;
}
function startEngine(){
	engineForm.action = "<%=request.getContextPath()%>/engineCtrl?engineStatus=run";
	engineForm.submit();	
}

function stopEngine(){
	engineForm.action = "<%=request.getContextPath()%>/engineCtrl?engineStatus=stop";
	engineForm.submit();	
}
</script>